#include "bubblesort.h"
#include "swap.h"

#include <stdlib.h>
#include <string.h>

/*****************************************************************************/

void bubblesort(char** words, int arraysize) {
    int i, j;
    for (i = 0 ; i < arraysize; i++) {
        for (j = 0; j+1 < arraysize - i; j++) {
            if (strcasecmp(words[j], words[j+1]) > 0) {
                swap(&words[j], &words[j+1]);
            }
        }
    }
}

/*****************************************************************************/

